home *** CD-ROM | disk | FTP | other *** search
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!-- This really needs a "break;" -->
- <xsl:template name="maxCols">
- <xsl:for-each select="//tr">
- <xsl:sort select="count(td)" order="descending" />
-
- <xsl:if test="position() = 1">
- <xsl:value-of select="." />
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
- <!-- This doesn't need a "break;" -->
- <xsl:template name="maxCols">
- <xsl:apply-templates select="//tr[1]" mode="maxCols" />
- </xsl:template>
-
- <xsl:template match="tr" mode="maxCols">
- <xsl:variable name="next"
- select="following-sibling::tr[count(td) > count(current()/td)][1]" />
-
- <xsl:choose>
- <xsl:when test="$next">
- <xsl:apply-templates select="$next" mode="maxCols" />
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:value-of select="count(td)" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
-
-
-